home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / msoftapp.zip / FILEWIN.H < prev    next >
C/C++ Source or Header  |  1993-06-01  |  2KB  |  69 lines

  1. // filewin.h : Declares the class interfaces for the application.
  2.  
  3. #ifndef __FILEWIN_H__
  4. #define __FILEWIN_H__
  5.  
  6. // Derived class to handle large line files
  7. class CLineFile : public CStdioFile
  8.     {
  9.     LONG    m_lBeginLine;   // 0 for beginning of file, -1 for don't know
  10.                             // offset of beginning of a line
  11.     DECLARE_DYNAMIC(CLineFile)
  12.  
  13. public:
  14.     CLineFile();
  15.     CLineFile(const char* pszFileName, UINT nOpenFlags);
  16.  
  17.     virtual LONG NextLine(char FAR* lpsz, UINT nMax);
  18.     virtual LONG BackLines(char FAR* lpsz, UINT nMax, UINT nLines);
  19.     virtual LONG LineNear(char FAR* lpsz, UINT nMax, LONG  lOffset);
  20.     virtual LONG SetBegin(LONG lnewBegin);
  21.  
  22.     LONG GetBegin() { return m_lBeginLine; };
  23.     virtual ~CLineFile();
  24.     };
  25.  
  26. class CFileWin : public CMDIChildWnd
  27.     {
  28.     CString strFileTitle;
  29.     CLineFile*  m_pMyFile;
  30.     short m_nVScrollPos;
  31.     short m_nHScrollPos;
  32.     CMenu* m_pMenuCurrent;
  33.     short m_ColorID;
  34.     COLORREF m_TextColor;
  35.  
  36.     LONG m_lTopLine;
  37.     LONG m_lFileSize;
  38.  
  39.     UINT m_nCxChar;
  40.     UINT m_nCyChar;
  41.     UINT m_nLinesPainted;
  42.     BOOL m_bWindowActive;
  43.  
  44. protected:
  45.     BOOL FileDlg(BOOL bOpen, int nMaxFile, LPSTR szFile,
  46.                     int nMaxFileTitle, LPSTR szFileTitle);
  47. public:
  48.     CFileWin();
  49.     ~CFileWin();
  50.  
  51.     BOOL Open();
  52.  
  53.     afx_msg int  OnCreate(LPCREATESTRUCT lpcs);
  54.     afx_msg void OnPaint();
  55.     afx_msg void OnAbout();
  56.     afx_msg void OnColor();
  57.     afx_msg void OnExit();
  58.     afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  59.     afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  60.     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  61.     afx_msg void OnMDIActivate(BOOL bActivate, CWnd*, CWnd*);
  62.     afx_msg void OnDestroy();
  63.     DECLARE_MESSAGE_MAP()
  64.     };
  65.  
  66. const SCROLLMAX  = 1000;
  67.  
  68. #endif // __FILEWIN_H__
  69.